package com.t11.provider.service.impl;

import com.t11.common.pojo.LzwUser;
import com.t11.common.service.UserService;
import com.t11.provider.mapper.UserMapper;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.cache.annotation.Cacheable;

import javax.annotation.Resource;

@DubboService
public class UserServiceImpl implements UserService {


    @Resource
    UserMapper userMapper;

    @Override
    @Cacheable(cacheNames = "users", key = "#phone")
    public LzwUser findUserByPhone(String phone) {
        return userMapper.findByPhone(phone);
    }
}
